package ggze.esp.dao.inter;
import ggze.esp.entity.FspUser;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface FspUserDao {
    @Insert("insert into FSP_USER (${name0}) values ('${value0}')")
    int add(@Param("name0") String n, @Param("value0") String v);

    @Delete("delete from FSP_USER where ${name1}='${value1}'")
    int delete(@Param("name1") String n, @Param("value1") String v);

    @Update("update FSP_USER set ${name2}='${value2}' where ${name4}='${value4}'")
    int update(@Param("name2") String n, @Param("value2") String v, @Param("name4") String va, @Param("value4") String vas);

    @Select("select * from FSP_USER")
    List<FspUser> allSelect();

    @Select("select  * from FSP_USER where ${name3}='${value3}'")
    FspUser isSelect(@Param("name3") String n, @Param("value3") String v);

    @Select("select  * from FSP_USER where ${tjname}='${tjva}' order by uuid limit ${begin},${end}")
    List<FspUser> paging(@Param("tjname") String tjname, @Param("tjva") String tjva, @Param("begin") int begin, @Param("end") int end);

    @Select("select  * from FSP_USER where ${ming}='${zhi}'")
    List<FspUser> isSelectSome(@Param("ming") String ming, @Param("zhi") String zhi);

    @Select("${sql}")
    FspUser custom(@Param("sql") String sql);

    @Select("select count(*) from FSP_USER where ${sqlName}='${sqlVal}'")
    int getNum(@Param("sqlName") String sqlName, @Param("sqlVal") String sqlVal);

    @Select("${sql1}")
    List<FspUser> customs(@Param("sql1") String sql1);

    @Select("${sql2}")
    int customsNum(@Param("sql2") String sql2);

    @Select("select * from FSP_USER where ${ming1} like '%${zhi1}%'")
    FspUser likeSeach(@Param("ming1") String ming1, @Param("zhi1") String zhi1);
}
